<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			let d1 = new Date();
			let d2 = new Date(2025,12,25);
			let c = d2.getTime() - d1.getTime();
			console.log(Math.floor(c / (24 * 3600 * 1000)));
			//2020年8月6日距离2025年12月25日还有多少天？
			let d = cal(2020,12,31) - cal(2020,8,6) + cal(2021,12,31) + cal(2022,12,31) + cal(2023,12,31) + cal(2024,12,31) + cal(2025,12,25);
			function cal(year,month,day){
				// let input_year = document.getElementById("input_year");
				// let input_month = document.getElementById("input_month");
				// let input_day = document.getElementById("input_day");
				// let year = parseInt(input_year.value);
				// let month = parseInt( input_month.value);
				// let day = parseInt(input_day.value);
				switch (month){
					case 12:
						day += 31;
					case 11:
						day += 30;
					case 10:
						day += 31;
					case 9:
						day += 30;
					case 8:
						day += 31;
					case 7:
						day += 31;
					case 6:
						day += 30;
					case 5:
						day += 31;
					case 4:
						day += 30;
					case 3:
						if(isRun(year)){
							day += 29;
						}else{
							day += 28;
						}
					case 2:
						day += 31;
					case 1:
				}
				console.log(day);
				// console.log("距离2025年的圣诞节还有" + day + "天");
				return day;
			}
			
			function isRun(year){
				if((year % 4 === 0 && year %100 != 0) || (year % 400 === 0)){
					return true;
				}
			}
		</script>
	</body>
</html>
